/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.workflow.domain;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author cmontes
 */
@Embeddable
public class SwimlanePK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -7425810002142687502L;
	@Basic(optional = false)
    @Column(name = "ID_PROCESS")
    private Long idProcess;
    @Basic(optional = false)
    @Column(name = "ID_DEPARTMENT")
    private Long idDepartment;

    public SwimlanePK() {
    }

    public SwimlanePK(Long idProcess, Long idDepartment) {
        this.idProcess = idProcess;
        this.idDepartment = idDepartment;
    }

    public Long getIdProcess() {
        return idProcess;
    }

    public void setIdProcess(Long idProcess) {
        this.idProcess = idProcess;
    }

    public Long getIdDepartment() {
        return idDepartment;
    }

    public void setIdDepartment(Long idDepartment) {
        this.idDepartment = idDepartment;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProcess != null ? idProcess.hashCode() : 0);
        hash += (idDepartment != null ? idDepartment.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof SwimlanePK)) {
            return false;
        }
        SwimlanePK other = (SwimlanePK) object;
        if ((this.idProcess == null && other.idProcess != null) || (this.idProcess != null && !this.idProcess.equals(other.idProcess))) {
            return false;
        }
        if ((this.idDepartment == null && other.idDepartment != null) || (this.idDepartment != null && !this.idDepartment.equals(other.idDepartment))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.SwimlanePK[ idProcess=" + idProcess + ", idDepartment=" + idDepartment + " ]";
    }
    
}
